package com.kalvan.web.servlet.response;

/**
 * 返回码
 *
 * @author chenliang
 */

public enum Code {

    CODE_SUCCESS(0, "成功"),
    CODE_NO_LOGIN(1, "尚未登录"),
    CODE_NO_PERMIT(2, "权限不足"),
    CODE_ERROR(3, "错误"),
    CODE_ERROR_PARAM(4, "参数有误"),
    CODE_ERROR_REQUEST(5, "非法请求"),

    ;
    private final int code;
    private final String msg;

    Code(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }

    @Override
    public String toString() {
        return this.msg;
    }
}
